package com.syh.jn.scm.domain.operation.repository.system;

import com.syh.core.ddd.infrastructure.repository.AggregateRepository;
import com.syh.core.ddd.infrastructure.repository.CreateRepo;
import com.syh.core.ddd.infrastructure.repository.DeleteRepo;
import com.syh.core.ddd.infrastructure.repository.UpdateRepo;
import com.syh.jn.scm.domain.operation.entity.system.OperationMenu;
import com.syh.jn.scm.infrastructure.repository.model.system.MenuPermissionModel;

import java.util.List;

public interface OperationMenuRepository extends OperationMenuReadRepository,
        CreateRepo<OperationMenu, Long>,
        UpdateRepo<OperationMenu, Long>,
        DeleteRepo<OperationMenu, Long> {

  /**
   * 维护菜单与权限中间表
   *
   * @param munePerm
   */
  void updateMenuPermission(MenuPermissionModel munePerm);

  /**
   * 根据菜单id删除权限
   *
   * @param menuId             菜单id
   * @param menuPermsDeleteIds
   */
  void removeMenuPermissionByIds(Long menuId, List<Long> menuPermsDeleteIds);

  /**
   * 修复旧数据的code
   */
  void fixOldDataCode();
}
